package com.ysg.widget.dialog;

import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.OnItemClickListener;
import com.ysg.R;
import com.ysg.base.BaseDialog;
import com.ysg.utils.YCollectionUtil;
import com.ysg.utils.YRecyclerViewUtil;
import com.ysg.widget.dialog.adapter.DialogSheetAdapter;
import com.ysg.widget.dialog.entity.DialogEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * 底部 sheetDialog
 */
public class CallDialog extends BaseDialog {
    public interface OnCallListener{
        void onAudioClick();
        void onVideoClick();
    }
    private OnCallListener listener;
    public void setOnCallListener(OnCallListener listener){
        this.listener = listener;
    }

    private View ivClose;
    private View tvAudio, tvVideo;

    public CallDialog(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.dialog_call;
    }

    public void initView() {
        setWidthScale(1f);
        Window window = getWindow();
        window.setGravity(Gravity.BOTTOM);

        ivClose = findViewById(R.id.ivClose);
        tvAudio = findViewById(R.id.tvAudio);
        tvVideo = findViewById(R.id.tvVideo);
    }

    @Override
    public void initData() {
    }

    @Override
    public void initListener() {
        ivClose.setOnClickListener((v -> {
            dismiss();
        }));
        tvAudio.setOnClickListener((v -> {
            dismiss();
            if (listener != null) listener.onAudioClick();
        }));
        tvVideo.setOnClickListener((v -> {
            dismiss();
            if (listener != null) listener.onVideoClick();
        }));





    }


}
